<!DOCTYPE html>
<html lang="en">
{% load staticfiles %}
<head>
    <meta charset="UTF-8">
    <title>index</title>
    <script src="{% static 'js/ajax_index.js'%}"></script>
    <script src="{% static 'js/jquery-3.3.1.js' %}"></script>
</head>
<body>
    <form method="post" id="test-form">
        {% csrf_token %}
        <input type="text" name="content" id="content">
        <input type="submit">
    </form>
<script>
    $(function()
    {
        $("#test-form").submit(function () {
            var content = $("#content").val();
            $.ajaxSetup(
                {
                    data: {csrfmiddlewaretoken: '{{ csrf_token }}'}
                }
            );
            $.ajax({
              type: "post"
            })
        })
    })
</script>
</body>
</html>